<?php
header('Content-type:text/html;charset=utf-8');//设置编码格式
session_start();
include_once 'dbconfig.php';
include_once 'common.php';

if ($_GET) {
    if (isset($_GET['getType']) && $_GET['getType'] == 'gitNew') {
        $num = $_GET['num'];
        $type = $_GET['type'];
        $selecuSqlStr = 'select * from product WHERE type =' . $type . ' limit 0,' . intval($num);
        judge($selecuSqlStr);
    }
    if (isset($_GET['getType']) && $_GET['getType'] == 'gitLike') {
        $num = $_GET['num'];
        $type = $_GET['type'];
        $selecuSqlStr = 'select * from product WHERE type =' . $type . ' limit 0,' . intval($num);
        judge($selecuSqlStr);
    }
    if (isset($_GET['getType']) && $_GET['getType'] == 'gitHot') {
        $num = $_GET['num'];
        $type = $_GET['type'];
        $selecuSqlStr = 'select * from product WHERE type =' . $type . ' limit 0,' . intval($num);
        judge($selecuSqlStr);
    }
}

if ($_POST) {
    if (isset($_POST['postType']) && $_POST['postType'] == 'addHotOne') {
        shopCartEvent();
    }
    if (isset($_POST['postType']) && $_POST['postType'] == 'addHotDown') {
        shopCartEvent();
    }
    if (isset($_POST['postType']) && $_POST['postType'] == 'addNewOne') {
        shopCartEvent();
    }
}

